<?php $this->loadHelper('common'); ?>
<?php $action = array(
    'subscribe' => 'Đăng ký LiveTV',
    'unsubscribe' => 'Hủy đăng ký LiveTV',
    'addTime' => 'Thêm giờ',
    'addAddonChannel' => 'Thêm kênh',
    'removeAddonChannel' => 'Hủy kênh',
    'worldcup' => 'Đăng ký gói Worldcup',
    'sendVod' => 'Gửi link xem video',
    'sendVodDown'   => 'Gửi link down video',
)
?>
<script type="text/javascript" src="/js/swfobject.js"></script>
<link type='text/css' href='/css/jquery.ui.css' rel='stylesheet' media='screen' />
<link type='text/css' href='/css/ui.daterangepicker.css' rel='stylesheet' media='screen' />
<script type="text/javascript" src="/js/jquery.daterangepicker.js"></script>
<script type="text/javascript" src="/js/jquery.ui.js"></script>

<div id="manager">
    <div>
        <div id="bg-title1"><img alt="" src="/images/bg-title1.jpg"/></div>
        <div id="bg-title2"><img alt="" style="margin-right: 8px;" src="/images/icon-title.jpg"/>Lịch sử giao dịch CC</div>
        <div id="bg-title3"><img alt="" src="/images/bg-title3.jpg"/></div>
        <div class="clearfloat"/>
    </div>
    <div id="content">
        <div class="area-content">
            <form name="frmStatistic" action="/admin/transaction" method="get">
                <div class="form">
                    <div class="form1b">Thời gian</div>
                    <div class="form2b">
                        <input type="text" style="width:300px" name="d" id="datepicker" value="<?php echo isset($duration) ? $duration : ''; ?>"/>
                        <script type="text/javascript">$('input#datepicker').daterangepicker();</script>
                        <?php if(isset($error['d'])): ?>
                            <div class="error"><?php echo $error['d'] ?></div>
                        <?php endif; ?>
                    </div>
                    <div class="clearfloat"></div>
                </div>
            </form>
        </div>
        <div class="area-button">
            <div class="area-button1">
                <a href="javascript:;" onclick="document.frmStatistic.submit();" class="button">Xác nhận</a>
            </div>
        </div>
    </div>
    <div class="clearfloat"></div>
</div></div>
<br/>
<div id="manager">
    <div>
        <div id="bg-title1"><img alt="" src="/images/bg-title1.jpg"/></div>
        <div id="bg-title2"><img alt="" style="margin-right: 8px;" src="/images/icon-title.jpg"/>Danh sách</div>
        <div id="bg-title3"><img alt="" src="/images/bg-title3.jpg"/></div>
        <div class="clearfloat"/>
    </div>
    <div id="content">
        <div class="area-content1">
            <?php if($data): ?>
            <input id="data" name="data" type="hidden" value="" />
            <div id="data-list" class="list-box">
                <table class="datagrid" width="100%">
                    <tbody>
                        <tr>
                            <th>Thuê bao</th>
                            <th>Hành động</th>
                            <th>Nội dung</th>
                            <th>Thời gian</th>
                            <th>Người thực hiện</th>
                            <th>Lý do</th>
                        </tr>
                        <?php foreach($data AS $item): ?>
                        <tr>
                            <td><?php echo $item['msisdn']; ?></td>
                            <td><?php echo isset($action[$item['action']]) ? $action[$item['action']] : ""; ?></td>
                            <td><?php echo $item['content']; ?></td>
                            <td><?php echo $item['created_time']; ?></td>
                            <td><?php echo $item['admin']; ?></td>
                            <td><?php echo $item['info']; ?></td>
                        </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
            <div class="clearfloat"></div>
            <?php else: ?>
            <p>Không có dữ liệu</p>
            <?php endif; ?>
        </div>
        <div class="clearfloat"></div>
    </div>
    <div class="clearfloat"></div>
</div></div>